Public Class Form1 Inherits System.Windows.Forms.Form #Region " Windows Form Designer generated code " Public Sub New() MyBase.New() 'This call is required by the Windows Form Designer. InitializeComponent() 'Add any initialization after the InitializeComponent() call End Sub 'Form overrides dispose to clean up the component list. Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) If disposing Then If Not (components Is Nothing) Then components.Dispose() End If End If MyBase.Dispose(disposing) End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. Friend WithEvents TxtGrade As System.Windows.Forms.TextBox Friend WithEvents Label1 As System.Windows.Forms.Label Friend WithEvents TxtPts As System.Windows.Forms.TextBox Friend WithEvents Label2 As System.Windows.Forms.Label Friend WithEvents BtnPts As System.Windows.Forms.Button Private Sub InitializeComponent() Me.TxtGrade = New System.Windows.Forms.TextBox Me.Label1 = New System.Windows.Forms.Label Me.TxtPts = New System.Windows.Forms.TextBox Me.Label2 = New System.Windows.Forms.Label Me.BtnPts = New System.Windows.Forms.Button Me.SuspendLayout() ' 'TxtGrade ' Me.TxtGrade.Location = New System.Drawing.Point(168, 40) Me.TxtGrade.Name = "TxtGrade" Me.TxtGrade.Size = New System.Drawing.Size(96, 20) Me.TxtGrade.TabIndex = 0 Me.TxtGrade.Text = "" ' 'Label1 ' Me.Label1.Location = New System.Drawing.Point(56, 40) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(88, 24) Me.Label1.TabIndex = 1 Me.Label1.Text = "Letter Grade" ' 'TxtPts ' Me.TxtPts.Location = New System.Drawing.Point(168, 120) Me.TxtPts.Name = "TxtPts" Me.TxtPts.ReadOnly = True Me.TxtPts.Size = New System.Drawing.Size(104, 20) Me.TxtPts.TabIndex = 2 Me.TxtPts.Text = "" ' 'Label2 ' Me.Label2.Location = New System.Drawing.Point(48, 120) Me.Label2.Name = "Label2" Me.Label2.Size = New System.Drawing.Size(96, 24) Me.Label2.TabIndex = 3 Me.Label2.Text = "Grade Points" ' 'BtnPts ' Me.BtnPts.Location = New System.Drawing.Point(168, 80) Me.BtnPts.Name = "BtnPts" Me.BtnPts.Size = New System.Drawing.Size(104, 24) Me.BtnPts.TabIndex = 4 Me.BtnPts.Text = "Grade Points" ' 'Form1 ' Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13) Me.ClientSize = New System.Drawing.Size(292, 273) Me.Controls.Add(Me.BtnPts) Me.Controls.Add(Me.Label2) Me.Controls.Add(Me.TxtPts) Me.Controls.Add(Me.Label1) Me.Controls.Add(Me.TxtGrade) Me.Name = "Form1" Me.Text = "Form1" Me.ResumeLayout(False) End Sub #End Region Private Sub BtnPts_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnPts.Click Dim points As Double Select Case TxtGrade.Text Case "A", "a", "A+", "a+" points = 4.0 Case "A-", "a-" points = 3.7 Case "B+", "b+" points = 3.3 Case "B", "b" points = 3.0 Case "B-", "b-" points = 2.7 Case "C+", "c+" points = 2.3 Case "C", "c" points = 2.0 Case "C-", "c-" points = 1.7 Case "D", "d" points = 1.0 Case "F", "f" points = 0.0 Case Else MsgBox("Yo, That's not a real grade") End Select TxtPts.Text = points.ToString("n1") End Sub End Class